package app.netant.badbook.auchu;

import cn.lily.com.enviroment.Enviroment;
import app.netant.book.base.BaseDetail;
import app.netant.book.base.BaseEntity;
import app.netant.book.base.BasePage;
import app.netant.book.base.BaseRoot;

public class AuchuRoot extends BaseRoot {
	
	public AuchuRoot(){
		this.homeUrl = "http://www.jipinxiaoshuo.cn/shuku.html";
		this.pageUrl = "http://www.jipinxiaoshuo.cn/shuku_6547_";
		this.tableKey = "jipinxs";
	}

	@Override
	public String buildUrl(int pageIdx) {
		if(pageIdx == 1){
			return homeUrl;
		}
		return this.pageUrl + pageIdx+".html";
	}

	@Override
	public BasePage buildPage(String url) {
		return new AuchuPage(url);
	}

	@Override
	public BaseDetail buildDetail(String url) {
		return new AuchuDetail(url);
	}

	@Override
	public BaseEntity buildEntity() {
		return new AuchuEntity();
	}
	
	@Override
	public void afterEntity(BaseEntity entity) {
		
	}
	
	public static void main(String[] args) {
		
		Enviroment.createEnv();
		Enviroment.getEnv().getLogBean().beginLog();
		
		AuchuRoot root = new AuchuRoot();
		root.analyse(131);
		//root.excepCycle();
	}


	
}
